#pragma once

#include "MovableText.h" 
#include "MovableTexture.h"

namespace moon
{

class  NameBoard
{
public:
	NameBoard(
		const Ogre::String &name
		, const std::wstring &caption);
	~NameBoard();

	void	showTitleIcon( Ogre::String name, Ogre::String fileName
		, float height, float width, float addHeight = 0.f, float left = 0.f );
// 
// 	void	setTextAlignment(
// 		const Ogre::MovableText::HorizontalAlignment& horizontalAlignment, 
// 		const Ogre::MovableText::VerticalAlignment& verticalAlignment)
// 		;
	void	setAdditionalHeight( Ogre::Real height );

	void	setTextVisible( bool bVisible );
	void	setTextColor( const Ogre::ColourValue &color );
	void	setTextBgrColor( const Ogre::ColourValue &color );
	void	setTextBgrOffsetPos( float OffsetH, float OffsetV, float OffsetD );

	void	setAutoScale( bool bAutoScale, float scaleK = 0.2f );
	void	setIconAutoScale( bool bAutoScale, float scaleK = 0.2f );
	bool	ifIconExist(){ return (m_pTitleIcon)? true : false;};
	

	void	attachText2Obj( Ogre::SceneNode * pNode );
	void	attachText2Bone( Ogre::Entity * pEntity, Ogre::String &boneName );

	void	detachText2Bone( Ogre::Entity * pEntity);
	void	detachIcon2Bone( Ogre::Entity * pEntity );

	void	attachIcon2Obj( Ogre::SceneNode * pNode );
	void	attachIcon2Bone( Ogre::Entity * pEntity, Ogre::String &boneName );

	float	getTextLen();
	void	updata();
protected:
	bool				m_bShow;
	bool				m_bShowName;
	bool				m_bShowTitle;

	float				m_BgrOffsetH;
	float				m_BgrOffsetV;
	float				m_BgrOffsetD;

	Ogre::MovableText		m_NameText;
	Ogre::MovableText		m_NameTextBgr;
	Ogre::MovableTexture*	m_pTitleIcon;

};

}//namespace moon